import Axios from '@/utils/request';

/**
 * 获取CDC运行监听状态
 * @param operateType 操作类型 autoRefresh:定时刷新，userAction：人为点击操作；operateType为空时
 * @returns
 */
export function getMonitorCdcStatus(operateType?: string) {
    // return Axios.get('/monitorCdc/status');
    return Axios({ url: '/monitorCdc/status', method: 'get', headers: { operateType: operateType } });
}

/**
 * 获取监控消息走势
 */
export function getMonitorCdcTrend(data: any, operateType?: string): Promise<any> {
    // return Axios.post('/monitorCdc/trend', data);
    return Axios({ url: '/monitorCdc/trend', method: 'post', data: data, headers: { operateType: operateType } });
}

/**
 * 获取监控消息走势详情
 */
export function getMonitorCdcTrendDetail(data: any): Promise<any> {
    return Axios.post('/monitorCdc/trend/detail', data);
}

/**
 * 导出监控消息走势
 */
export function exportMonitorCdcTrend(data: any): Promise<any> {
    return Axios.post('/monitorCdc/trend/export', data);
}

/**
 * 获取表分布
 */
export function getTableDistribute(data: any, operateType?: string): Promise<any> {
    // return Axios.post('/monitorCdc/tableDistribute', data);
    return Axios({ url: '/monitorCdc/tableDistribute', method: 'post', data: data, headers: { operateType: operateType } });
}

/**
 * 获取表分布详情
 */
export function getTableDistributeDetail(data: any): Promise<any> {
    return Axios.post('/monitorCdc/distribute/detail', data);
}

/**
 * 获取监听表下拉数据
 */
export function getTableData(): Promise<any> {
    return Axios.get('/monitorCdc/table/select');
}

/**
 * 获取监听数据详情
 */
export function getDetail(data: any, operateType?: string): Promise<any> {
    // return Axios.post('/monitorCdc/detail', data);
    return Axios({ url: '/monitorCdc/detail', method: 'post', data: data, headers: { operateType: operateType } });
}
